// author by welong
// zuowl@qq.com
// 2014-09-05  09:49
// PAT basic 1007

#include <stdio.h>
#include <math.h>

#define bool  unsigned char
#define true  1
#define false 0

bool primer(int n)
{
	int i, isqrt = (int)sqrt(n);	//if not sqrt(n) cause the last test site error
					//out of time
	for(i = 2; i <= isqrt;i++)
	{
		if(n % i == 0)
			return false;
	}
	return true;
}

int main(int argc, char **argv)
{
	int i, num, count = 0;
	int prev_primer = 0;

	scanf("%d", &num);
	
	for(i = 3; i <= num; i+=2)
	{
		if(primer(i))
		{
			if((i - prev_primer) == 2)
				count++;
			prev_primer = i;
		}
	}
	printf("%d", count);
	return 0;
}